/*
 * @Author: chenxiao
 * @Date: 2022-01-26 13:15:38
 * @LastEditors: chenxiao
 * @LastEditTime: 2022-05-01 21:05:30
 */

// 在这里给默认值, 因为值要带到分公司跳转后的页面, 再跳回来要保持选择的值
import {getChangeDate} from '@/view/cityTrafficNew/component/choostTime/getTime'

const {startData, endData} = getChangeDate()
export default {
  state: {
    firstTabId: 0,
    timeObj: {
      startData: startData,
      endData: endData
    },
    show: true,
    tabIndex: 1,
    tableIndex: 1,
    firstTableActive: 0,
    firstTableActive1: 0,
    selectRange: {
      start: 1,
      end: 20
    },
    intentFlag: false,
    timeActive: 0,
    firstFlag: 0,

  },
  mutations: {
    // 一级菜单标识
    SETFIRSTTABID (state, id) {
      state.firstTabId = id
    },
    // 时间选择
    SETTIMEOBJ (state, obj) {
      // console.log('时间选择');
      // console.log(state.timeObj, 'timeobj')
      state.timeObj.startData = obj.startData
      state.timeObj.endData = obj.endData
      
    },
    SETSHOW (state, bool) {
      // console.log('show', bool)
      state.show = bool
    },
    SETTABINDEX (state, tabIndex) {
      state.tabIndex = tabIndex
    },
    SETTABLEINDEX (state, tableIndex) {
      state.tableIndex = tableIndex
    },
    SETFIRSTTABLEACTIVE (state, index) {
      state.firstTableActive = index
    },
    SETFIRSTTABLEACTIVE1 (state, index) {
      state.firstTableActive1 = index
    },
    SETSELECTRANGE (state, range) {
      state.selectRange = range
    },
    SETINTENTFLAG (state, bool) {
      state.intentFlag = bool
    },
    SETTIMEACTIVE (state, active) {
      state.timeActive = active
    },
    // 设置标识
    SETFIRSTFLAG (state, flag) {
      state.firstFlag = flag
    }
  }
}
